UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yGQxg7AwbfKgnRBTdFJuJo3i0RVAYMHz9wWuW6jvM+A=' 
WHERE 
  key_id = '71a3202a9a7540b534f7f0d06a02d4aab762e4615b8e8db4accec58d024b5eeb' 
  AND (
    token = 'yGQxg7AwbfKgnRBTdFJuJo3i0RVAYMHz9wWuW6jvM+A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034