UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/GR3AAp84aLbq2LZQmqzuzlxcO1Ycq/9YrhaPXyo2uY=' 
WHERE 
  key_id = 'ff8dcb90025bb0b36e8946e14297584d4b408f272dead1f55cf4671ce475a376' 
  AND (
    token = '/GR3AAp84aLbq2LZQmqzuzlxcO1Ycq/9YrhaPXyo2uY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033