UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GVJWdgUjCK1ZFfAS0vWuqoFw7iN7Mb8oy/nwCvIWuXA=' 
WHERE 
  key_id = 'c0ccc54b0929aac21cecb5cd00dd09cba5264d923b7923589798e068c006a2ea' 
  AND (
    token = 'GVJWdgUjCK1ZFfAS0vWuqoFw7iN7Mb8oy/nwCvIWuXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034