UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B0ZTq13XrCCImIzsUROFF/7A6QEGxARTuM9N3AD6WZg=' 
WHERE 
  key_id = 'c48ac1eb6d46e2f0a2cb8ba94c85534f8a93e82ef5dfe8202a85754b8def4999' 
  AND (
    token = 'B0ZTq13XrCCImIzsUROFF/7A6QEGxARTuM9N3AD6WZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037