UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GOHbs0M1bGRZVqg7bwVyY+/9jYeiuZHfult2e8kS9z4=' 
WHERE 
  key_id = '5f2581d4decfb1eaeadcbabb6d517d9a1a0d06156e57b65b714ec2fe0c89ff87' 
  AND (
    token = 'GOHbs0M1bGRZVqg7bwVyY+/9jYeiuZHfult2e8kS9z4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021