UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GNdF7fDVErpEyFTHQ13PGc2wXw6cFj8X3oQwJEK7WYA=' 
WHERE 
  key_id = 'ebf17d4155e729fa7cbc46a649499995c6c9aee43733027080c088701446da35' 
  AND (
    token = 'GNdF7fDVErpEyFTHQ13PGc2wXw6cFj8X3oQwJEK7WYA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027