UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rsnDqRJWqgqAFut2re2HVDTqruyMUwV2iRzT9zKbA9M=' 
WHERE 
  key_id = '4066894484cc2ccaa6c4fd85961334dbedc75648d220cc23ffd428f793904259' 
  AND (
    token = 'rsnDqRJWqgqAFut2re2HVDTqruyMUwV2iRzT9zKbA9M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039