UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JEJKQMYqleuQkQS5DDzvZfSb8elZzP8tzVhnYwsLhtc=' 
WHERE 
  key_id = 'e5f50860bf1e0ae16b3a07bd5b8875a591f9fdf54cb7eb20c2fd5b530d0ff043' 
  AND (
    token = 'JEJKQMYqleuQkQS5DDzvZfSb8elZzP8tzVhnYwsLhtc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028