UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vF0CfGlph3STHtOvbP2jLeQIAtK8B0ojf0Owmm+Q7nQ=' 
WHERE 
  key_id = '337d25d09de26dcc02384bcb19acdcf6a9c99999b93d51a12e4b891d197c0b54' 
  AND (
    token = 'vF0CfGlph3STHtOvbP2jLeQIAtK8B0ojf0Owmm+Q7nQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034