UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U06RZP2A7DrQsJvGpdoqa/0QW3hY3BqEq7uNl53JP1U=' 
WHERE 
  key_id = '8d5235e43de60cefd5f2a43264bd6c60ee8638fc369af7deefcdff0f01fc92aa' 
  AND (
    token = 'U06RZP2A7DrQsJvGpdoqa/0QW3hY3BqEq7uNl53JP1U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00121