UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2yF2D9pIv0IM9fvMRT4xdchB7OieTbDLZ/JnqovbQ8k=' 
WHERE 
  key_id = '2eb5d588dc7d66669e4877685623f32ee0be1f909446c053e29da2f82dfa1a99' 
  AND (
    token = '2yF2D9pIv0IM9fvMRT4xdchB7OieTbDLZ/JnqovbQ8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042