UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qhr3CIHs8KPK6yxeVUJZpbEjBSJrVyn5fDMjLzg/oHQ=' 
WHERE 
  key_id = '57de2eab42fb46acc943ab62f042900ca58dd0d8fd77a81313c866432d6958a0' 
  AND (
    token = 'qhr3CIHs8KPK6yxeVUJZpbEjBSJrVyn5fDMjLzg/oHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034