UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jMSz37/Iq6FQTAJ0T0zzZJYJ9wEqfdBWXKjhuq5tfrk=' 
WHERE 
  key_id = '73ed6b76a0510256b756b85d0ebce37373a74c52932658a7bb6cb3e04563a47c' 
  AND (
    token = 'jMSz37/Iq6FQTAJ0T0zzZJYJ9wEqfdBWXKjhuq5tfrk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033