UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zo4YCUIS+0e2iQ2Pivy+jppvyaGS7BoWvEQQK8MniuA=' 
WHERE 
  key_id = '53c62f1ebc65813a7cbe375d46eeaa6f0ed4f3c0461426e2ce86f3ac8074e0a2' 
  AND (
    token = 'Zo4YCUIS+0e2iQ2Pivy+jppvyaGS7BoWvEQQK8MniuA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035