UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ShKC5OMWvjrehhs3/KvUC9J2J3X+kKm6Sc+muh3xULA=' 
WHERE 
  key_id = 'fe45bf8cc4b7609555b0b97ee5bfd3141cb0d8e22c2c6713f703c27785be0c20' 
  AND (
    token = 'ShKC5OMWvjrehhs3/KvUC9J2J3X+kKm6Sc+muh3xULA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050