UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XsBxKEDyRKCEU3GUm7ZQlNdsPn7K/VluJiGIuTtCKAU=' 
WHERE 
  key_id = '09c9e386da25364a30780628c5ac9f2d93f5c5ed1d1e5324397aec4789e0c4cc' 
  AND (
    token = 'XsBxKEDyRKCEU3GUm7ZQlNdsPn7K/VluJiGIuTtCKAU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029