UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+6CuzWX0HK+/iqxxOUHMGQipZozFxANQ1A3oYPfXPfw=' 
WHERE 
  key_id = '9455a7610cb6b49782deb6a7f6ffd05d11dd9dfcf8ce62005567a968a313d053' 
  AND (
    token = '+6CuzWX0HK+/iqxxOUHMGQipZozFxANQ1A3oYPfXPfw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052