UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'unB76l9aU4BFKU8+UpKEW2wkGwPAzzms0K/KVKKaNMU=' 
WHERE 
  key_id = '894f5f50442f824a15b149dd9dd9094c3cdc9c5352f1c683a4752ebd789d8a7f' 
  AND (
    token = 'unB76l9aU4BFKU8+UpKEW2wkGwPAzzms0K/KVKKaNMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028