UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KJhesnZ9dzoSEgL9VtgljZhioBfwmJDosQdPb6Eh1c8=' 
WHERE 
  key_id = '1983120719db5da2100f021250073d57a8e384f1122ffca2dec4edbe7eb62f1a' 
  AND (
    token = 'KJhesnZ9dzoSEgL9VtgljZhioBfwmJDosQdPb6Eh1c8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017