UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mi0kCJFO6p3Re3PU8cWSrNrolKRN50bUeKolXCcL5hY=' 
WHERE 
  key_id = '8482ea82ac8624d932835fd5a5f0bcb10041a085568395bdb859e67c98154a36' 
  AND (
    token = 'Mi0kCJFO6p3Re3PU8cWSrNrolKRN50bUeKolXCcL5hY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028