UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e7eMcZGsk/q32DVxuo3k+peuKI1/725kJNYgmDhVzsQ=' 
WHERE 
  key_id = '34b7c3aac7aac561443eb176bf70628c0309fa7761c2c7723ff6ba6a55b362e5' 
  AND (
    token = 'e7eMcZGsk/q32DVxuo3k+peuKI1/725kJNYgmDhVzsQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041