UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zlwc4J3NzuSY+PyJ90Ts6x2LjryQdRuILre21TLdjy0=' 
WHERE 
  key_id = '7ee77e3170c2a277b8f84dd4246664d50aecc1ece99d6517800803e42a277122' 
  AND (
    token = 'zlwc4J3NzuSY+PyJ90Ts6x2LjryQdRuILre21TLdjy0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031