UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GKhtq8hhMOgANrIPIwQHUz2DgJTq4Y9X2MRjfy2sUfI=' 
WHERE 
  key_id = '33235ed28391895771b83535a50b8e962886eec5bee08f7bbac52a9a94bab516' 
  AND (
    token = 'GKhtq8hhMOgANrIPIwQHUz2DgJTq4Y9X2MRjfy2sUfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020