UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vwlp5kYFnm/CK64+jUBBBUikd9Eqoxud7BYcNgUt6ok=' 
WHERE 
  key_id = 'ddc7e40b68b54aa850628bba3ae568c6d6e6481ed0fb9e0d577eeb8f7fac81c2' 
  AND (
    token = 'vwlp5kYFnm/CK64+jUBBBUikd9Eqoxud7BYcNgUt6ok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045