UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '89iAIOo6iUOASKBIbp3Cs6O7H9PAhhT2i7SvMjuyfks=' 
WHERE 
  key_id = '7d21b75aabe9f7d88a5330b1bac1c0c22fd45dac67e094c6c42b3bd45e5b56a9' 
  AND (
    token = '89iAIOo6iUOASKBIbp3Cs6O7H9PAhhT2i7SvMjuyfks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037