UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Stu86PzR90XPJll+WuMP7GDHfsTfNoreSffHGjuMNHI=' 
WHERE 
  key_id = '90db04027f2904b91d286b05e4dbbd105ad8e803da022c77fde614a1345d47ea' 
  AND (
    token = 'Stu86PzR90XPJll+WuMP7GDHfsTfNoreSffHGjuMNHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030