UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kSniwKXob3B+P4m1SdvTFBcbWLNcgtXEf/6T/zQj8Gk=' 
WHERE 
  key_id = '114b6480cbeba34695495ebdd96ad04d8aa369e6b5c05c78c32fb4e1adde3ec5' 
  AND (
    token = 'kSniwKXob3B+P4m1SdvTFBcbWLNcgtXEf/6T/zQj8Gk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036