UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WeGgUBqTRoSFkLsBdRJy+qgDlBjpQz0DI8iC48iw9Rg=' 
WHERE 
  key_id = '791ea095fa3d3532cfe7a87d3f6a0a8c23173f88602bdcd95958a03c8be957f9' 
  AND (
    token = 'WeGgUBqTRoSFkLsBdRJy+qgDlBjpQz0DI8iC48iw9Rg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018